var api = "/api/productDetails";
var id;
var title;
$(function () {
    title = $("input[name='title']").val();
    console.log(title)
    $('title').text('广联官方网站 产品详情 ' + title);
    $(".product-nav-title span").text(title);
    $(".tag-item").text(title);
    if (title === "户外电源") {
        $(".banner-wrap img").attr("src", "http://localhost:8080/upload/img-fmeTAL-005135.jpg")
        $(".introduction-category-item a").eq(2).addClass('bottom-line');
    } else if (title === "应急电源") {
        $(".banner-wrap img").attr("src", "http://localhost:8080/upload/img-d7agOy-660178.jpg");
        $(".introduction-category-item a").eq(3).addClass('bottom-line')
    } else if (title === "锂电洗车机") {
        $(".banner-wrap img").attr("src", "http://localhost:8080/upload/img-A44s8W-102750.jpg")
        $(".introduction-category-item a").eq(4).addClass('bottom-line')
    } else {
        $(".banner-wrap img").attr("src", "http://localhost:8080/upload/img-fy91bJ-446759.jpg");

        $(".introduction-category-item a").eq(5).addClass('bottom-line')
    }

    var imgList = $("input[name='imgList']").val();
    if (imgList) {
        var imglistStr = JSON.parse(imgList)
        $.each(imglistStr, function (index, item) {
            var img = $('<img style="width: 100%;height: 100%;" src="' + item + '"> ');
            $(".product-details").append(img);
        })
    }

});


$(".introduction-category-item a").click(function () {
    $(".product-nav-title").text($(this).text())
    console.log($(this).text())
    if ($(this).text() === title ) {

    }else if($(this).text() === "产品中心"){

    }else {
        console.log(1111)
        $(this).addClass("bottom-line").parent().siblings().children().removeClass("bottom-line");
    }

})
